<%-- 
    Document   : minna
    Created on : Jul 23, 2013, 3:26:51 PM
    Author     : USERT
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/DetailedLesson.css" rel="stylesheet" type="text/css"/>
        <title>Minna</title>
    </head>
    <script type="text/javascript">
        function changeText(){
            var lName = document.getElementById("lNameparam");
            lName.value = lName.value.replace("[[#text:","");
            lName.value = lName.value.replace("]]", "");
            document.write(lName.value);
        }  
    </script>
    <body>
        <c:set var="lessonId" value="${param.lessonId}"/>
        <c:import var="lessonXML" url="xml/LessonLists.xml" charEncoding="UTF-8"/>
        <x:parse var="lessonDoc" xml="${lessonXML}"/>
        

    <div style="margin: auto; width: 990px;">
        <div class="header">
            <c:import url="header.jsp"/>
        </div>
        <div class="content">
            <div class="content_left">
                <c:choose>
                    <c:when test="${not empty USERNAME}">
                        <c:import url="login-success.jsp">
                            <c:param name="user" value="${USERNAME}"/>
                        </c:import>
                    </c:when>
                    <c:otherwise>
                        <c:import url="loginBox.jsp"/>
                    </c:otherwise>
                </c:choose>
            </div>

            <c:if test="${not empty lessonId}">
        <x:forEach var = "lesson" select="$lessonDoc//*[local-name()='lessonList']">
            <x:if select="$lesson//*[local-name()='lessonId']= $lessonId">
                <x:set var="lessonName"  select="$lesson//*[local-name()='lessonName']/text()"/>
            </x:if>
        </x:forEach>
    <param id="lNameparam" value="${lessonName}"/>
            <div class="content_right">
                <div id="page" style="width: 100%; height: 100%;">
                    <div id="wrap" class="divwraphead">
                        <div id="top">
                            <div id="N_title">
                                <div id="left-title">
                                </div>
                                <div style="background: url('Images/left-title-bg.png') repeat scroll 0% 0% transparent;
                                     float: left; height: 32px; font-size: 16px; width: 125px; text-align: center;"
                                     >
                                    <div style="color: white; padding-top: 6px ">Tên bài</div>
                                </div>
                                <div id="lessonName" style="padding-top: 6px; padding-left: 2px; float: left">
                                    <script>
                                        changeText();
                                    </script>
                                </div>
                            </div>
                        </div>
                        <div id="mid">

                            <div id="wrapper">
                                <div id="wrapperitem" style="margin: auto; margin-left: 15px">
                                    <div id="tuvung" class="partofminna">
                                        <a href="ControllerServlet?action=ldetail&lessonId=${param.lessonId}&detailType=tuvung">
                                            <img class="image" src="Images/tuvung.png"/>
                                            <span class="label">
                                                <h3 class="h3">Từ vựng</h3>
                                            </span>
                                        </a>
                                    </div>
                                    <div id="nguphap" class="partofminna">
                                        <a href="DetailedLesson.jsp?lessonId=${param.lessonId}&detailType=nguphap">
                                            <img class="image" src="Images/nguphap.png"/>
                                            <span class="label">
                                                <h3 class="h3">Ngữ pháp</h3>
                                            </span>
                                        </a>
                                    </div>

                                    <div id="luyendoc" class="partofminna">
                                        <a href="DetailedLesson.jsp?lessonId=${param.lessonId}&detailType=luyendoc">
                                            <img class="image" src="Images/luyendoc.png"/>
                                            <span class="label">
                                                <h3 class="h3">Luyện đọc</h3>
                                            </span>
                                        </a>
                                    </div>
                                    <div id="hoithoai" class="partofminna">
                                        <a href="DetailedLesson.jsp?lessonId=${param.lessonId}&detailType=hoithoai">
                                            <img class="image" src="Images/hoithoai.png"/>
                                            <span class="label">
                                                <h3 class="h3">Hội thoại</h3>
                                            </span>
                                        </a>
                                    </div>
                                    <div id="luyennghe" class="partofminna">
                                        <a href="DetailedLesson.jsp?lessonId=${param.lessonId}&detailType=luyennghe">
                                            <img class="image" src="Images/nghe.png"/>
                                            <span class="label">
                                                <h3 class="h3">Luyện nghe</h3>
                                            </span>
                                        </a>
                                    </div>
                                    <div id="baitap" class="partofminna">
                                        <a href="DetailedLesson.jsp?lessonId=${param.lessonId}&detailType=baitap">
                                            <img class="image" src="Images/baitap.png"/>
                                            <span class="label">
                                                <h3 class="h3">Bài tập</h3>
                                            </span>
                                        </a>
                                    </div>
                                    <div id="hantu" class="partofminna">
                                        <a href="DetailedLesson.jsp?lessonId=${param.lessonId}&detailType=hantu">
                                            <img class="image" src="Images/hantu.png"/>
                                            <span class="label">
                                                <h3 class="h3">Hán tự</h3>
                                            </span>
                                        </a>
                                    </div>
                                    <div id="luyentap" class="partofminna">
                                        <a href="DetailedLesson.jsp?lessonId=${param.lessonId}&detailType=luyentap">
                                            <img class="image" src="Images/baitap.png"/>
                                            <span class="label">
                                                <h3 class="h3">Luyện tập</h3>
                                            </span>
                                        </a>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
                                            </c:if>
        </div>
    </div>
    <div class="foot-wrap">
        Assignment - Group Điền Nam Ngọc<br/>
        FPT - University
    </div>

</body>
</html>
